
CC = gcc
CFLAGS = -Wall -ggdb -std=c99 -fPIC -I../include
LIBS = -lpthread

AR = ar
ARFLAGS = -cr

SRC = tc_alloc.c tc_hash.c tc_list.c tc_mpool.c tc_prioq.c tc_tree.c zc_log.c rbtree.c splaytree.c    zc_stack.c zc_queue.c zc_slist.c zc_dlist.c zc_tree.c zc_hash.c zc_mempool.c zc_pool.c
OBJ = tc_alloc.o tc_hash.o tc_list.o tc_mpool.o tc_prioq.o tc_tree.o zc_log.o rbtree.o splaytree.o    zc_stack.o zc_queue.o zc_slist.o zc_dlist.o zc_tree.o zc_hash.o zc_mempool.o zc_pool.o

%.o:%.c
	$(CC) -c $(CFLAGS) $< -o $@

all:$(OBJ)
	$(CC) $(CFLAGS) -shared $(LIBS) $(OBJ) -o ./libtc.so
	$(AR) $(ARFLAGS) ./libtc.a $(OBJ)

clean:
	$(RM) $(OBJ) ./libtc.so ./libtc.a

#test:
#	$(CC) $(CFLAGS) -I$(LIBS) -L. confdump.c -o confdump -static -ltc
#	$(CC) $(CFLAGS) -I$(LIBS) -L. conf-parse.c -o conf-parse -static -ltc
#

test:
	$(CC) $(CFLAGS) $(LIBS) -L. zc_test.c libtc.a -o zc_test # -static -ltc

